package rentcar.web.converters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import rentcar.domain.Car;
import rentcar.service.CarService;


 
@Component
public class StringToCarConverter implements Converter<String, Car> {

	   @Autowired
	private CarService carService;	
	
@Override
    public Car convert(String carId) {
        return carService.getCarByID(new Long(carId));	 
  }	   
	   
}
